//package org.jeecg.uass;
//
//import com.ccb.uass.client.cs.AuthException;
//import com.ccb.uass.client.cs.UassClient;
//import com.ccb.uass.client.cs.UassClientFactory;
//import com.ccb.uass.client.cs.entity.Credential;
//import com.ccb.uass.client.cs.entity.LoginType;
//import com.ccb.uass.client.cs.entity.Principal;
//import com.ccb.uass.client.cs.entity.Transaction;
//import com.ccb.uass.utils.crypto.CryptoUtil;
//
//import java.io.IOException;
//import java.security.MessageDigest;
//import java.security.NoSuchAlgorithmException;
//
//
//public class StaticPwdAuth {
//
//	public static void main(String[] args) throws IllegalArgumentException,
//			IOException, InterruptedException {
//
//		UassClient uc = UassClientFactory.client();
//		Principal p = new Principal();
//		Credential cred = new Credential();
//		cred.setTransaction(Transaction.AUTH_PASSWORDD);
//		String username = "chengzhiwei.zh";
//		String password = "ccb123456";
//		cred.setLoginName(username);
//		cred.setSecVoucher(password);
//		cred.setLoginType(LoginType.LOGIN_NAME);
//		cred.setClientIp("192.168.6.28");
//		try {
//			p = uc.login(cred);
//			System.out.println(p.getAttributes());
//		} catch (AuthException e) {
//			System.out.println(e.getReturnCode() + e.getMessage());
//			e.printStackTrace();
//		}
//	}
//
//	public static String encrypt(String plainText){
//		MessageDigest md;
//		try {
//			md = MessageDigest.getInstance("MD5");
//			md.update(plainText.getBytes());
//			return  CryptoUtil.parseByte2HexStr(md.digest()).toLowerCase();
//		} catch (NoSuchAlgorithmException e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		}
//		return plainText;
//	}
//}
